<template>
    <router-view></router-view>
</template>

<script setup lang="ts">
function setRem() {
    const ui_w = 375;
    // 获取屏幕的宽度
    let clientWidth = document.documentElement.clientWidth || document.body.clientWidth;
    if (clientWidth > 750) {
        clientWidth = 750;
    }

    // 通过js动态改变html根节点字体大小
    const html_ = document.getElementsByTagName('html')[0];
    html_.style.fontSize = (clientWidth / ui_w) * 10 + 'px';
}
// window.onresize 浏览器被重置大小执行事件
onMounted(() => {
    setRem();
    window.onresize = setRem;
});
</script>
